home *** CD-ROM | disk | FTP | other *** search
/ Suzy B Software 2 / Suzy B Software CD-ROM 2 (1994).iso / animatin / anim_q2z / statusdm / programs / run_man / run_man.s < prev   
Text File  |  1995-04-26  |  9KB  |  381 lines

  1.  ************************************ START **************************************
  2.  
  3.         include    d:gemmacro.s
  4.  
  5. * the program proper
  6.  
  7. start        move.l    4(a7),a3        base page
  8.         move.l    #mystack,a7
  9.         move.l    $c(a3),d0        text len
  10.         add.l    $14(a3),d0        data len
  11.         add.l    $1c(a3),d0        BSS len
  12.         add.l    #$100,d0        basepage
  13.         move.l    d0,-(a7)
  14.         move.l    a3,-(a7)
  15.         clr.w    -(a7)
  16.         move.w    #$4a,-(a7)
  17.         trap    #1            shrink memory
  18.         lea    12(a7),a7
  19.  
  20.         appl_init
  21.         move.w    d0,ap_id        store the application id
  22.  
  23.         graf_handle
  24.         move.w    d0,current_handle    Desktop's VDI handle
  25.  
  26. * start by opening a virtual workstation
  27.  
  28.         lea    intin,a0
  29.         moveq    #10-1,d0        -1 for DBF
  30. .fill        move.w    #1,(a0)+        most params are 1
  31.         dbf    d0,.fill
  32.         move.w    #2,(a0)+        use RC system
  33.  
  34.         v_opnvwk            open it
  35.  
  36.         v_hide_c
  37.  
  38. ********************************************************************************
  39.         include    d:macros.s
  40.  
  41. ************************************ MAIN **************************************
  42.     
  43. * what is the current resolution?  Store it in mode1!
  44.         xbcall    #4,2
  45.         move.w    d0,mode1
  46.  
  47. * where are the physbase and logbase?  Store them in orig1 and orig2!
  48.         xbcall    #2,2
  49.         move.l    d0,orig1
  50.  
  51.         xbcall    #3,2
  52.         move.l    d0,orig2
  53.     
  54. * allocates 96k, enough for 3 screens!
  55.         m_alloc    #96256,m_start1
  56.  
  57. * finds a good starting address for the first screen...
  58.         scr_a_c    m_start1,screen1
  59.  
  60. * makes screen3 = screen1, then adds 32000 to screen1
  61.         move.l    screen1,screen3
  62.         add.l    #32000,screen1
  63.  
  64. * makes screen2 = screen1, then adds 32000 to screen1
  65.         move.l    screen1,screen2
  66.         add.l    #32000,screen1
  67.  
  68. * now we clear all the screens...
  69.         set_scr    #-1,screen3
  70.         v_clrwk    
  71.         set_scr    #-1,screen2
  72.         v_clrwk
  73.         set_scr    #-1,screen1
  74.         v_clrwk
  75.  
  76. * opens the PI1 file with my screen data...
  77.         f_open    0,f_name1,f_hand1
  78.  
  79. * gets resolution and sets it...
  80.         f_read    #mode2,#2,f_hand1
  81.         rez    mode2
  82.  
  83. * gets palette and sets it...
  84.         f_read    #palette,#32,f_hand1
  85.         set_palette palette
  86.  
  87. * reads in screen data and displays it...only 9600 bytes/60 scan lines
  88.         f_read    screen1,#9600,f_hand1
  89.  
  90. * closes file...
  91.         f_close    f_hand1
  92.  
  93. * Sets up MFDB1
  94.         move.l    screen1,address1
  95.         move.w    #320,widthnpix1
  96.         move.w    #200,heightnpix1
  97.         move.w    #20,widthnwords1
  98.         move.w    #1,formflag1
  99.         move.w    #4,numofplanes1
  100.         move.l    #0,reserveda1
  101.         move.l    #0,reservedb1
  102.  
  103. * Sets up MFDB2
  104.         move.l    screen2,address2
  105.         move.w    #320,widthnpix2
  106.         move.w    #200,heightnpix2
  107.         move.w    #20,widthnwords2
  108.         move.w    #1,formflag2
  109.         move.w    #4,numofplanes2
  110.         move.l    #0,reserveda2
  111.         move.l    #0,reservedb2
  112.  
  113. * Sets up MFDB3
  114.         move.l    screen3,address3
  115.         move.w    #320,widthnpix3
  116.         move.w    #200,heightnpix3
  117.         move.w    #20,widthnwords3
  118.         move.w    #1,formflag3
  119.         move.w    #4,numofplanes3
  120.         move.l    #0,reserveda3
  121.         move.l    #0,reservedb3
  122.  
  123. * set up variables for the rasters....
  124. x1        ds.w    1        upper left corner of source
  125. y1        dc.w    1        y1.w = 1 forever and ever....
  126. x2        ds.w    1        lower right corner of source
  127. y2         dc.w    60        y2.w = 60 forever and ever... 
  128.  
  129. x3        ds.w    1        upper left x of dest...
  130. y3        ds.w    1        upper left y of dest...
  131. x4        ds.w    1        lower right x of dest...
  132. y4        ds.w    1        lower right y of dest...
  133.  
  134. * sets up our source values...
  135.         move.w    #10,d4
  136.         move.w    #4,d5
  137.         move.w    #1,x1
  138.         move.w    #49,x2
  139.  
  140. * sets our destinations to values...
  141.         move.w    #0,x3        x3 = 0
  142.         move.w    #70,y3        y3 = 70
  143.         move.w    #47,x4        x4 = 47
  144.         move.w    #130,y4        y4 = 130
  145.  
  146.  
  147. loop1
  148.  
  149. part1 
  150. * moves visible raster...
  151.         move.w    x1,ptsin
  152.         move.w    y1,ptsin+2
  153.         move.w    x2,ptsin+4
  154.         move.w    y2,ptsin+6
  155.  
  156.         move.w    x3,ptsin+8
  157.         move.w    y3,ptsin+10
  158.         move.w    x4,ptsin+12
  159.         move.w    y4,ptsin+14
  160.      
  161.         vro_cpyfm #3,#mfdb1,#mfdb2  
  162.  
  163.         set_scr    screen2,screen3
  164.         xbcall    #37,2
  165.         xbcall    #37,2
  166.         xbcall    #37,2
  167.         v_clrwk   
  168.  
  169. * swaps screen values...
  170.         move.l    screen3,dummyL
  171.         move.l    screen2,screen3
  172.         move.l    dummyL,screen2
  173.  
  174. * adjusts a values in MFDB2 and MFDB3 for the screen...
  175.         move.l    screen2,address2
  176.         move.l    screen3,address3
  177.  
  178. * waits for keypress...
  179. *         inkey 
  180.  
  181. * moves the window in the source raster...    
  182.         add.w    #49,x1
  183.         add.w    #49,x2
  184.  
  185. * adds to destination...
  186.         add.w    #4,x3
  187.         add.w    #4,x4
  188.  
  189.           cmp.w    #319,x4
  190.         bge    termn8
  191.  
  192. * loops until d5 is content with life...
  193.         dbra    d5,loop1
  194.  
  195.  
  196. * resets the screen variables...
  197.         sub.w    #98,x1
  198.         sub.w    #98,x2
  199.         move.w    #2,d5
  200.        
  201. loop2
  202.  
  203. * creates a new raster!
  204.         move.w    x1,ptsin
  205.         move.w    y1,ptsin+2
  206.         move.w    x2,ptsin+4
  207.         move.w    y2,ptsin+6
  208.     
  209.         move.w    x3,ptsin+8
  210.         move.w    y3,ptsin+10
  211.         move.w    x4,ptsin+12
  212.         move.w    y4,ptsin+14
  213.  
  214.         vro_cpyfm #3,#mfdb1,#mfdb2
  215.     
  216.         set_scr    screen2,screen3
  217.         xbcall    #37,2
  218.         xbcall    #37,2
  219.         xbcall    #37,2
  220.         v_clrwk
  221.    
  222. * swaps screen values...
  223.         move.l    screen3,dummyL
  224.         move.l    screen2,screen3
  225.         move.l    dummyL,screen2
  226.  
  227. * adjusts a values in MFDB2 and MFDB3 for the screen...
  228.         move.l    screen2,address2
  229.         move.l    screen3,address3
  230.  
  231. * waits for keypress...
  232. *        inkey
  233.  
  234. * moves the window in the source raster...    
  235.         sub.w    #49,x1
  236.         sub.w    #49,x2
  237.  
  238. * adds to destination...
  239.         add.w    #4,x3
  240.         add.w    #4,x4
  241.  
  242.         cmp.w    #319,x4
  243.         bge    termn8
  244.  
  245. * loops until d5 is content with life...
  246.         dbra    d5,loop2
  247.     
  248. * resets source info...
  249.         move.w    #1,x1
  250.         move.w    #48,x2
  251.         move.w    #4,d5
  252.  
  253.         dbra    d4,loop1
  254.  
  255. termn8    
  256.         m_free    m_start1     
  257.         set_palette palinfo
  258.         set_scr    orig1,orig2
  259.         rez    #1
  260.         bra    terminate
  261.  
  262. ********************************************************************************
  263.         include    d:errors.s
  264.         include    d:terminat.s
  265.  
  266. ********************************************************************************
  267.  
  268.         SECTION    DATA
  269.  
  270. * The six files I will be messing with......
  271.  
  272. f_name1        dc.b    '\run_man.pi1',0
  273.  
  274. * Stuff for my kinda online monitoring....by seeing output as i go!
  275.  
  276. crlf        dc.b    13,10,0            values for a cr/lf 
  277.  
  278. * Variable containing some generic palette data for the editor...
  279.  
  280. palinfo        dc.w    $777,$700,$070,$000,$000,$000,$000,$000
  281.         dc.w    $000,$000,$000,$000,$000,$000,$000,$000
  282.  
  283. * global constants
  284.  
  285.     SECTION    BSS
  286. ********************************************************************************
  287.  
  288. * Used in the application's "startup" sequence....vroom!
  289.  
  290. ap_id        ds.w     1
  291.  
  292.         ds.l    100        stack space
  293.  
  294. mystack        ds.w    1        (stacks go backwards)
  295.  
  296. ********************************************************************************
  297. * Used for m_alloc and m_free calls.  I define as many of these as I think
  298. * I will need.....3 is about the maximum for what I plan to do!
  299.  
  300. ram_free    ds.l    1        amount of RAM in bytes
  301.  
  302. m_start1    ds.l    1        address of first m_alloc call
  303. m_start2    ds.l    1        address of 2nd   "    "   "
  304. m_start3    ds.l    1        address of 3rd   "    "   "
  305.  
  306. m_error        ds.w    1        space for error
  307.  
  308. ********************************************************************************
  309. * Now, some variables for file handling.......
  310. * I don't think I'll personally use more than 6 files at once...
  311.  
  312. f_hand1        ds.w    1        word for file #1's handle
  313. f_hand2        ds.w    1        "  "  "   "   #2's  "  "
  314. f_hand3        ds.w    1        "  "  "   "   #3's  "  "
  315. f_hand4        ds.w    1        "  "  "   "   #4's  "  "
  316. f_hand5        ds.w    1        "  "  "   "   #5's  "  "
  317. f_hand6        ds.w    1        "  "  "   "   #6's  "  "
  318.  
  319. fname1        ds.b    13        12 bytes terminated with a 0
  320.     
  321.         even
  322.  
  323. file_size    ds.l    1
  324.  
  325. ********************************************************************************        
  326. * Now.....to go thru the arduous process of creating the offsets for the 
  327. * Line-A calls.  Sure, I can call stuff thru GEM, but what if I don't want
  328. * to?  Riiiiiiight!
  329.  
  330. orig1        ds.l    1        ptr to original screen1
  331. orig2        ds.l    1        ptr to original screen2
  332.  
  333. screen1        ds.l    1        address of screen1
  334. screen2        ds.l    1        address of screen2
  335. screen3        ds.l    1        address of screen3
  336.  
  337. palette        ds.w    16        pointer to palette
  338. mode1        ds.w    1        space for mode
  339. mode2        ds.w    1        
  340.  
  341. dummyL        ds.l    1        dummy variable
  342.  
  343. mfdb1        
  344. address1    ds.l    1
  345. widthnpix1    ds.w    1
  346. heightnpix1    ds.w    1
  347. widthnwords1    ds.w    1
  348. formflag1    ds.w    1        usually 1
  349. numofplanes1    ds.w    1        number of bit planes
  350. reserveda1    ds.w    2        set to 0...reserved
  351. reservedb1    ds.w    2        "   "  "  "  "   "
  352. reservedc1    ds.w    1        "   "  "  "  "   "
  353.  
  354. mfdb2
  355. address2    ds.l    1
  356. widthnpix2    ds.w    1
  357. heightnpix2    ds.w    1
  358. widthnwords2    ds.w    1
  359. formflag2    ds.w    1        usually 1
  360. numofplanes2    ds.w    1        number of bit planes
  361. reserveda2    ds.w    2        set to 0...reserved
  362. reservedb2    ds.w    2        "   "  "  "  "   "
  363. reservedc2    ds.w    1        "   "  "  "  "   "
  364.  
  365.  
  366. mfdb3
  367. address3    ds.l    1
  368. widthnpix3    ds.w    1
  369. heightnpix3    ds.w    1
  370. widthnwords3    ds.w    1
  371. formflag3    ds.w    1        usually 1
  372. numofplanes3    ds.w    1        number of bit planes
  373. reserveda3    ds.w    2        set to 0...reserved
  374. reservedb3    ds.w    2        "   "  "  "  "   "
  375. reservedc3    ds.w    1        "   "  "  "  "   "
  376.  
  377. * if not linking then include the run-times
  378.  
  379.     include    d:aeslib.s
  380.     include    d:vdilib.s
  381.